package com.qintian.rainstorm.modules.sever.impl;

import com.qintian.rainstorm.datasourcse.DataSourceNames;
import com.qintian.rainstorm.datasourcse.annnotiaon.DataSource;
import com.qintian.rainstorm.modules.dao.RqcDao;
import com.qintian.rainstorm.modules.sever.RqcServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: chz
 * @Date: 2019/1/3 15:56
 * @Describe:
 */
@Service("RqcServer")
public class RqcImpl implements RqcServer {

    @Autowired
    RqcDao rqcDao;

    @DataSource(name = DataSourceNames.FIRST)
    @Override
    public List<String> getRqcStation(String time) {
        String temp = time.substring(0, 4) + "-" + time.substring(4, 6) + "-" + time.substring(6, 8);
        return rqcDao.getRqcStation(temp);
    }
}
